<%@page pageEncoding="UTF-8" import="java.sql.*"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<jsp:useBean id="event" scope="session" class="com.asaga.tools.Event_DBImpl" />
<jsp:useBean id="userProfile" scope="session" class="com.asaga.tools.SystemClient_DBImpl" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@ include file="header.jsp" %>
<body>
<div id="container">
    <%@ include file="topNav.jsp" %>
    <%@ include file="leftside.jsp" %>
    <%@ include file="rightside.jsp" %>
    <div id="content">
        <div class="eventShowing">
        </div>
    </div>
<!--end content -->
<div class="myEvents">
    <%if(userProfile.getEmail() == null){%> 
    <%}
    else{%>
    <% ResultSet myEvents = event.getEventsByPersonId(userProfile.getId());
    %>
    <h4 class="heading">My Events</h4>
    <ul>
        <%if(myEvents.next()){
        myEvents.first();
        while(myEvents.next()){
        %>
        <li class="eventListing">
            <span class="eventTitle">
                <%=myEvents.getString("title")%>    
            </span><br />
            Date:<%=myEvents.getDate("startDate")%> thru
            <%=myEvents.getDate("endDate")%><br />
            Time:<%=myEvents.getTime("startTime")%> - <%=myEvents.getTime("endTime")%>
        </li>
        <%       }
        } else{
        %>
        <span class="eventTitle">No events created </span>
        <%}%>
    </ul>
    <span class="eventDisplay"><a href="AutismSiteMasterController?action=addEventForm">Add an Event</a></span>
    <span class="eventDisplay"><a href="AutismSiteMasterController?action=listEvents">List My Events</a></span>
    <%}%>
</div>

<%@ include file="footer.jsp" %>
</div>
</body>
</html>